package com.adminsystem.service.impl;

import com.adminsystem.entity.SysUser;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.adminsystem.entity.SysRole;
import com.adminsystem.service.SysRoleService;
import com.adminsystem.mapper.SysRoleMapper;
import org.springframework.stereotype.Service;

/**
 * @author Administrator
 * @description 针对表【sys_role(角色表)】的数据库操作Service实现
 * @createDate 2023-09-22 16:53:13
 */
@Service
public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole>
        implements SysRoleService {

    @Override
    public SysRole getByRoleName(String name) {

        return getOne(new QueryWrapper<SysRole>().eq("name", name));
    }

    @Override
    public SysRole getByRoleCode(String code) {
        return getOne(new QueryWrapper<SysRole>().eq("code", code));
    }
}




